package com.mvp.shq.washer.utils;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

import com.mvp.shq.washer.entity.shop.AddressData;
import com.mvp.shq.washer.entity.shop.ShopProductJump;
import com.mvp.shq.washer.entity.shop.TotalOrderData;
import com.mvp.shq.washer.entity.shop.result.OrderResult;
import com.mvp.shq.washer.ui.aboutUs.AboutUsActivity;
import com.mvp.shq.washer.ui.contactUs.ContactUsActivity;
import com.mvp.shq.washer.ui.coupon.CouponActivity;
import com.mvp.shq.washer.ui.faultFeedBack.FaultFeedBackActivity;
import com.mvp.shq.washer.ui.feendBack.FeedBackActivity;
import com.mvp.shq.washer.ui.forgetPWD.ForgetPWDActivity;
import com.mvp.shq.washer.ui.login.LoginActivity;
import com.mvp.shq.washer.ui.main.MainActivity;
import com.mvp.shq.washer.ui.modifyMobile.ModifyMobileActivity;
import com.mvp.shq.washer.ui.news.NewsActivity;
import com.mvp.shq.washer.ui.orderConfirm.OrderConfirmActivity;
import com.mvp.shq.washer.ui.orderDetail.OrderDetailActivity;
import com.mvp.shq.washer.ui.paySuccess.PaySuccessActivity;
import com.mvp.shq.washer.ui.paySuccess.PaySuccessConstract;
import com.mvp.shq.washer.ui.qrcodeShare.QrcodeShareActivity;
import com.mvp.shq.washer.ui.reg.RegActivity;
import com.mvp.shq.washer.ui.resetPwd.ResetPwdActivity;
import com.mvp.shq.washer.ui.rule.RuleActivity;
import com.mvp.shq.washer.ui.setting.SettingActivity;
import com.mvp.shq.washer.ui.shareApp.ShareAppActivity;
import com.mvp.shq.washer.ui.shop.category.CategoryActivity;
import com.mvp.shq.washer.ui.shop.comment.CommentActivity;
import com.mvp.shq.washer.ui.shop.mall.MallActivity;
import com.mvp.shq.washer.ui.shop.order.myorder.MyOrderActivity;
import com.mvp.shq.washer.ui.shop.order.orderdesc.OrderDescActivity;
import com.mvp.shq.washer.ui.shop.order.orderpay.OrderPayActivity;
import com.mvp.shq.washer.ui.shop.order.ordersubmit.OrderSumbitActivity;
import com.mvp.shq.washer.ui.shop.order.ordertake.OrderTakeActivity;
import com.mvp.shq.washer.ui.shop.order.refund.RefundActivity;
import com.mvp.shq.washer.ui.shop.product.ProductActivity;
import com.mvp.shq.washer.ui.shop.productComment.ProductCommentActivity;
import com.mvp.shq.washer.ui.shop.productDetail.ProductDetailActivity;
import com.mvp.shq.washer.ui.shop.shopAddAddress.ShopAddAddressActivity;
import com.mvp.shq.washer.ui.shop.shopAddress.ShopAddressActivity;
import com.mvp.shq.washer.ui.shop.shopCollection.ShopCollectionActivity;
import com.mvp.shq.washer.ui.shop.shopUserCenter.ShopUserCenterActivity;
import com.mvp.shq.washer.ui.shop.shopcar.ShopCarActivity;
import com.mvp.shq.washer.ui.userCenter.UserCenterActivity;
import com.mvp.shq.washer.ui.wallet.WalletActivity;
import com.mvp.shq.washer.ui.web.WebActivity;
import com.mvp.shq.washer.ui.withdraw.WithDrawActivity;

/**
 * Created by Administrator on 2017/8/24.
 */

public class JumpUtil {
    public static void toMain(Context context){
        Intent intent = new Intent(context, MainActivity.class);
        context.startActivity(intent);
    }
    public static void toWallet(Context context){
        Intent intent = new Intent(context, WalletActivity.class);
        context.startActivity(intent);
    }
    public static void toUserCenter(Context context){
        Intent intent = new Intent(context, UserCenterActivity.class);
        context.startActivity(intent);
    }
    public static void toNews(Context context){
        Intent intent = new Intent(context, NewsActivity.class);
        context.startActivity(intent);
    }
    public static void toLogin(Context context){
        Intent intent = new Intent(context, LoginActivity.class);
        context.startActivity(intent);
    }
    public static void toReg(Context context){
        Intent intent = new Intent(context, RegActivity.class);
        context.startActivity(intent);
    }
    public static void toForgetPWD(Context context){
        Intent intent = new Intent(context, ForgetPWDActivity.class);
        context.startActivity(intent);
    }
    public static void toShare(Context context){
        Intent intent = new Intent(context, ShareAppActivity.class);
        context.startActivity(intent);
    }
    public static void toSetting(Context context){
        Intent intent = new Intent(context, SettingActivity.class);
        context.startActivity(intent);
    }
    public static void toContactUs(Context context){
        Intent intent = new Intent(context, ContactUsActivity.class);
        context.startActivity(intent);
    }
    public static void toOrderDetail(Context context,String orderNo){
        Intent intent = new Intent(context, OrderDetailActivity.class);
        Bundle bundle = new Bundle();
        bundle.putString("orderNo",orderNo);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }
    public static void toOrderConfirm(Context context, String washerNo){
        Intent intent = new Intent(context, OrderConfirmActivity.class);
        Bundle bundle = new Bundle();
        bundle.putString("washerNo",washerNo);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }
    public static void toResetPwd(Context context){
        Intent intent = new Intent(context, ResetPwdActivity.class);
        context.startActivity(intent);
    }
    public static void call(Context context,String phone){
        Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"+phone));
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }
    public static void toAboutUs(Context context){
        Intent intent = new Intent(context, AboutUsActivity.class);
        context.startActivity(intent);
    }
    public static void toModifyMobile(Context context){
        Intent intent = new Intent(context, ModifyMobileActivity.class);
        context.startActivity(intent);
    }
    public static void toCoupon(Context context,int type){
        Intent intent = new Intent(context, CouponActivity.class);
        Bundle bundle = new Bundle();
        bundle.putInt("type",type);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }
    public static void toFeenBack(Context context){
        Intent intent = new Intent(context, FeedBackActivity.class);
        context.startActivity(intent);
    }
    public static void toPaySuccess(Context context,String orderNo){
        Intent intent = new Intent(context, PaySuccessActivity.class);
        Bundle bundle = new Bundle();
        bundle.putString("orderNo",orderNo);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }
    public static void toWithDraw(Context context){
        Intent intent = new Intent(context, WithDrawActivity.class);
        context.startActivity(intent);
    }
    public static void toFaultFeedBack(Context context){
        Intent intent = new Intent(context, FaultFeedBackActivity.class);
        context.startActivity(intent);
    }
    public static void toQrcodeShare(Context context){
        Intent intent = new Intent(context, QrcodeShareActivity.class);
        context.startActivity(intent);
    }
    public static void toWeb(Context context,String url){
        Intent intent = new Intent(context, WebActivity.class);
        Bundle bundle = new Bundle();
        bundle.putString("url",url);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }
    public static void toRule(Context context,String key){
        Intent intent = new Intent(context, RuleActivity.class);
        Bundle bundle = new Bundle();
        bundle.putString("key",key);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }
    public static void toMall(Context context){
        Intent intent = new Intent(context, MallActivity.class);
        context.startActivity(intent);
    }
    public static void toCategory(Context context){
        Intent intent = new Intent(context, CategoryActivity.class);
        context.startActivity(intent);
    }
    public static void toProductList(Context context, ShopProductJump params){
        Intent intent = new Intent(context, ProductActivity.class);
        Bundle bundle = new Bundle();
        bundle.putSerializable(ShopProductJump.KEY,params);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }
    public static void toProductDetail(Context context,String productId,String type){
        Intent intent = new Intent(context, ProductDetailActivity.class);
        Bundle bundle = new Bundle();
        bundle.putString("productId",productId);
        bundle.putString("type",type);

        intent.putExtras(bundle);
        context.startActivity(intent);
    }
    public static void toProductComment(Context context,String productId){
        Intent intent = new Intent(context, ProductCommentActivity.class);
        Bundle bundle = new Bundle();
        bundle.putString("productId",productId);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }
    public static void toOrderProductComment(Context context){
        Intent intent = new Intent(context, CommentActivity.class);
        context.startActivity(intent);
    }
    //跳转购物车界面
    public static void toShopCar(Context context){
        Intent intent = new Intent(context, ShopCarActivity.class);
        context.startActivity(intent);
    }

    /**跳转订单提交界面
     * @param context
     * @param pageType  0：商品详情，1:购物车
     */
    public static void toOrderSumbit(Context context,int pageType){
        Intent intent = new Intent(context, OrderSumbitActivity.class);
        intent.putExtra("pageType",pageType);
        context.startActivity(intent);
    }
    //跳转订单支付界面
    public static void toOrderPay(Context context,int formType,String orderId){
        Intent intent = new Intent(context, OrderPayActivity.class);
        intent.putExtra("type",formType);
        intent.putExtra("orderId",orderId);
        context.startActivity(intent);
    }
    //跳转订单详情界面
    public static void toOrderDesc(Context context){
        Intent intent = new Intent(context, OrderDescActivity.class);
        context.startActivity(intent);
    }
    //跳转订单详情界面
    public static void toOrderDesc(Context context,String orderId){
        Intent intent = new Intent(context, OrderDescActivity.class);
        intent.putExtra("orderId",orderId);
        context.startActivity(intent);
    }
    public static void toShopUserCenter(Context context){
        Intent intent = new Intent(context, ShopUserCenterActivity.class);
        context.startActivity(intent);
    }
    public static void toShopAddress(Context context,int type){
        Intent intent = new Intent(context, ShopAddressActivity.class);
        intent.putExtra("type",type);
        context.startActivity(intent);
    }
    public static void toShopAddAddress(Context context, int type, AddressData addressData){
        Intent intent = new Intent(context, ShopAddAddressActivity.class);
        Bundle bundle = new Bundle();
        bundle.putInt("type",type);
        bundle.putSerializable("address",addressData);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }
    public static void toShopCollection(Context context){
        Intent intent = new Intent(context, ShopCollectionActivity.class);
        context.startActivity(intent);
    }
    //跳转订单待收货界面
    public static void toOrderTake(Context context,String orderId){
        Intent intent = new Intent(context, OrderTakeActivity.class);
        intent.putExtra("orderId",orderId);
        context.startActivity(intent);
    }
    //跳转退款界面
    public static void toRefund(Context context,String orderId,double cashPrice,double integoryPrice,double totalPrice){
        Intent intent = new Intent(context, RefundActivity.class);
        intent.putExtra("orderId",orderId);
        intent.putExtra("cashPrice",cashPrice);
        intent.putExtra("integoryPrice",integoryPrice);
        intent.putExtra("totalPrice",totalPrice);
        context.startActivity(intent);
    }
    //跳转我的订单界面
    public static void toMyOrder(Context context){
        Intent intent = new Intent(context, MyOrderActivity.class);
        context.startActivity(intent);
    }
}
